<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改')" />
</head>
<body class="white-bg" th:object="${payTransRsp}">
	<!--请求报文-->
    <div class="wrapper wrapper-content animated fadeInRight ibox-content" >
		<div class="form-group">
			<label class="col-sm-1 control-label" style="font-size: 20px">请求报文：</label>
			<div class="col-sm-10">
				<textarea th:field="*{req}" type="text" name="" class="form-control"  style="margin: 0px 19.2344px 0px 0px; width: 90%; height: 100px;"></textarea>
			</div>
		</div>
    </div>
	<!--返回报文-->
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<div class="form-group">
			<label class="col-sm-1 control-label" style="font-size: 20px">返回报文：</label>
			<div class="col-sm-10">
				<textarea th:field="*{rsp}" type="text" name="" class="form-control"  style="margin: 0px 19.2344px 0px 0px; width: 90%; height: 100px;"></textarea>
			</div>
		</div>
	</div>
	<!--订单号-->
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<div class="form-group">
			<label class="col-sm-1 control-label" style="font-size: 20px">订单号：</label>
			<div class="col-sm-10">
				<span id="outTradeNum" style="font-size: 32px"></span>
			</div>
		</div>
	</div>
	<!--成功 提示框-->
	<div id="pay" class="alert alert-success" style="margin-top: 5%; width: 82%; height: 25%;display: none">
		<span id="successWithdrawalPay" style="font-size: 32px"></span>
	</div>
	<!--失败 提示框-->
	<div id="unknownPay" class="alert alert-danger" style="margin-top: 5%; width: 82%; height: 25%;display: none">
		<span id="errorWithdrawalPay" style="font-size: 32px"></span>
	</div>

	<div th:include="include::footer"></div>
    <script th:inline="javascript">
        var withdrawalRsp = [[${withdrawalRsp}]];
        var outTradeNum = [[${outTradeNum}]];
        var error = [[${error}]];
        var check = [[${check}]];

        //订单号
        document.getElementById("outTradeNum").innerText = outTradeNum;


        // 取款密码错误 or 验证码验证失败
        if (error === 0){
            // 取款密码错误
            if (check === 0) {
                $("#unknownPay").css({'display':'block'});
                document.getElementById("errorWithdrawalPay").innerText = "取款密码错误！";
			}
            if (check === 1) {
                $("#unknownPay").css({'display':'block'});
                document.getElementById("errorWithdrawalPay").innerText = "验证码验证失败！";
            }
            if (check === 2) {
                $("#unknownPay").css({'display':'block'});
                document.getElementById("errorWithdrawalPay").innerText = "请求异常！请联系管理员！";
            }
        }
        // 取款密码正确   验证码正确
        if (error === 1) {
            if (withdrawalRsp.code == "success"){
                $("#pay").css({'display':'block'});
                document.getElementById("successWithdrawalPay").innerText = withdrawalRsp.msg + "！";
            }else {
                $("#unknownPay").css({'display':'block'});
                document.getElementById("errorWithdrawalPay").innerText = withdrawalRsp.msg + "！";
            }
		}
	</script>
</body>
</html>
